<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <%@include file="/WEB-INF/pages/common/head.jsp"%>
</head>
<body>
<div class="container">
    <c:set var="count" value="0"/>
    <c:set var="total" value="0"/>
    <c:forEach items="${child}" var="a">
        <c:set var="dictionary" value="${a.dictionary}"/>
        <c:set var="count" value="${count+a.totalPrice}"/>
        <c:set var="total" value="${total+a.purchaseBuy}"/>

    </c:forEach>
    <div class="row">
        <div class="col-md-3">物资编码:${dictionary.cgCode}</div>
        <div class="col-md-3">物资名称:${dictionary.cgName}</div>
        <div class="col-md-3">物资规格:${dictionary.spec}</div>
        <div class="col-md-3">物资单位:${dictionary.unit}</div>
    </div>
    <div class="row">
        <div class="col-md-3">采购数量:${total}</div>
        <div class="col-md-3">金额（元）:${count}</div>
    </div>
    <table class="table" id="am">
        <tr>
            <th>序号</th>
            <th>发起科室</th>
            <th>发起人</th>
            <th>采购数量</th>
            <th>单位（元）</th>
            <th>合计（元）</th>
            <th>发起时间</th>
        </tr>
        <c:forEach items="${child}" var="a">
            <c:set var="dictionary" value="${a.dictionary}"/>
            <tr>
                <td>${a.purchaseChildId}</td>
                <td>${a.department.departmentName}</td>
                <td>${a.createBy}</td>
                <td>${a.purchaseBuy}</td>
                <td>${a.dictionary.price}</td>
                <td>${a.totalPrice}</td>
                <td><fmt:formatDate value="${a.createDate}" pattern="yyyy-MM-dd"/> </td>
            </tr>
        </c:forEach>
    </table>
    <button onclick="location.href='procurement/orderGenerate/index'" class="btn btn-default">返回</button>

</div>
<%@include file="/WEB-INF/pages/common/modal.jsp"%>
<script>
    $("th,td").addClass("text-center");
    $("th,td").css({"border":"1px solid #dddddd"});
</script>
</body>
</html>